#ifndef PWM_H
#define PWM_H

/**
 * @defgroup nxbot_pwm PWM Library
 * @ingroup nxbot_low_level
 * @code #include <pwm.h> @endcode
 * @brief PWM library for applying different velocities to the motors in NXBOT. 
 *
 * This module uses timer0 of the ATmega1281 microcontroller for generating the desired PWM signals. 
 * This library does not need to have the interrupts in order to function correctly.
 * 
 */
 
/**@{*/

#include <avr/io.h>
#include "nxbot.h"
#define MASK_FREQ 0xF8
#define PRESCALER_1 1
#define PRESCALER_8 2
#define PRESCALER_64 3
#define PRESCALER_256 4
#define PRESCALER_1024 5
#define MAX_PWM 127

void configPwm(unsigned char freq);

void setFreqPwm(unsigned char freq);

unsigned char getFreqPwm(void);


void setPwmRight(signed char right);

void setPwmLeft(signed char left);
/**@}*/
#endif
